package com.hw.servlet;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet(name = "GServlet",urlPatterns = "/gg")
public class GServlet extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        System.out.println("asdf");
       String s= (String) request.getAttribute("num");
       response.sendRedirect("https://www.baidu.com/s?ie=utf-8&f=8&rsv_bp=1&tn=baidu&wd=HttpServletResponse&oq=HttpServletResponse%2520%25E8%258F%259C%25E9%25B8%259F%25E6%2595%2599%25E7%25A8%258B&rsv_pq=80477f44000172bb&rsv_t=2548t68O4bpiJCgARxYZIxJXY%2BW1QTl287THMEAU6ehNrh5jdNQE7N5cYdQ&rqlang=cn&rsv_enter=1&inputT=123&rsv_sug3=63&rsv_sug1=27&rsv_sug7=100&rsv_sug2=0&rsv_sug4=674");
    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        doPost(request,response);
    }
}
